/*
   Copyright (C) 2022 Ivan Polyakov

   This file is part of fltube.

   fltube is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   fltube is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

#ifndef FLTUBE_SEARCH_BOX_HXX_ENTRY
#define FLTUBE_SEARCH_BOX_HXX_ENTRY

#include "gui.config.h"
#include <FL/Fl_Group.H>
#include <FL/Fl_Input.H>
#include <FL/Fl_Button.H>

namespace fltube
{
    class SearchBox : public Fl_Group {
        Fl_Input *input;

    public:
        /*
         * \param x X coord
         * \param y Y coord
         * \param w Width
         * \param h Height
         */
        SearchBox(int x, int y, int w, int h);

        const char *GetSearchQuery() const
        { return input->value(); }

        virtual ~SearchBox() {}
    private:
        static void SearchButtonPressed(Fl_Widget *wdt, void *val);
    };
}

#endif // FLTUBE_SEARCH_BOX_HXX_ENTRY
